package com.zyf.workflow.flow;

import com.zyf.workflow.business.osinstall.OSInstallWorker;
import com.zyf.workflow.business.osinstall.bean.OSBean;
import com.zyf.workflow.node.WorkNode;
import com.zyf.workflow.node.bean.NodeResultBean;
import com.zyf.workflow.worker.Worker;
import com.zyf.workflow.worker.bean.WorkerResultBean;

public class WorkFlowTest {

    public static void main(String[] args) {

        OSBean osBean = new OSBean();
        osBean.setFileName("centos7.iso");
        osBean.setFilePath("/opt/iso/");
        OSInstallWorker osInstallWorker = new OSInstallWorker();



//        Worker<OSBean, WorkerResultBean> worker = osInstallWorker::install;

//        WorkNode<OSBean, NodeResultBean> workNode1= new WorkNode.Builder<OSBean,NodeResultBean>()
////                .withWorker(worker)
//                .withNodeId(1)
//                .withData(osBean)
//                .withName("osInstallNode")
//                .setCallBack(new OsInstallCallBack())
//                .withType("noop")
//                .create();

//        WorkNode<OSBean, NodeResultBean> workNode2= new WorkNode.Builder<OSBean,NodeResultBean>()
////                .withWorker(worker)
//                .withNodeId(2)
//                .withData(osBean)
//                .withName("osInstallNode2")
//                .setCallBack(new OsInstallCallBack())
//                .withType("noop")
//                .create();


//        WorkFlow workFlow = new WorkFlow.Builder().withNode(workNode1).withNode(workNode2).setCallBack(new WorkFlowCallBack() {
//            @Override
//            public void onWorkFlowCompleted() {
//                System.out.println("flow finished");
//            }
//        }).create();


//        System.out.println(workFlow);


    }
}
